#ifndef __MY_MP3_H
#define __MY_MP3_H

#include "spi_flash_v3.h"
#include "myfat.h"
#include "myoled.h"

//解码后pcm数据缓存区的大小
//#define  PCM_BUFF_SIZE  2304*2

#define  PCM_BUFF_SIZE  2304*2

enum audio_player_state_e
{
	AUDIO_PLAYER_FREE = 0,  //表明当前没有在播放视频文件(或者说音频文件播放完毕)
	AUDIO_PLAYER_PLAYING,   //表明当前处于视频播放状态
	AUDIO_PLAYER_PAUSE,     //表明当前处于播放暂停状态
};

typedef struct audio_player_obj_s
{
	int     state;           //播放器的状态
	uint8_t *pcm_buff;
	int     pcm_pkg_size;    //解码后一包pcm数据的实际大小, pcm_pkg_size<=PCM_BUFF_SIZE
	int     sample_freq;     //音频的采样频率
	int     channels;        //音频的声道数
	int     sample_bits;     //音频的量化比特数(采样分辨率) 8 16 ...
	uint8_t sound_wave_buff[PCM_BUFF_SIZE/2];  //波形显示
	uint32_t count;
}audio_player_obj_t;

void test_audio(void);
void find_mp3();
int  audio_player_start2(char *fname);
void audio_player_stop(void);
#endif